import {Point} from './Pointts'

export class Circle
{
    yuanxin:Point = new Point(0,0)//初始化,"|"是或者
    radius:number = 0;

    constructor(yuanxin:Point,radius:number)
    {
        this.yuanxin = yuanxin
        this.radius = radius
    }
    isPointInCircle(point:Point):boolean
    {
        let distance:number = this.yuanxin.get_distance(point)//yuanxin后面需要加一个问号
        return distance <= this.radius//看看点到圆心的距离是否小于等于半径长度
    }
}

let point:Point = new Point(0,0)
let c1:Circle = new Circle(point,2)
console.log(c1);

let point22:Point = new Point(2,2)
let result:boolean = c1.isPointInCircle(point22)
console.log(result);